

const bb = window.bootbox;
bb.setLocale("zh_CN");
bb.setDefaults({locale:"zh_CN"});

// bootbox.confirm({title: "提示",message: "这是一个确认按钮的样式！",buttons: {confirm: {label: 'Yes',className: 'btn-success'},cancel: {label: 'No',className: 'btn-danger'}},callback: function (result) {console.log('这是回调函数来确认最终结果: ' + result);}});

export default {

    /**
     *
     */
    alert: (msg, cb) => {
        bb.alert({
            message: msg,
            backdrop: true,
            callback: () => {
                if (cb) {
                    cb();
                }
            }
        });
    },

    /**
     *
     */
    confirm: (msg, cb) => {
        bb.confirm({
            message: msg,
            backdrop: true,
            callback: (flag) => {
                if (flag && cb) {
                    cb();
                }
            }
        });
    }
}